<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let obj1={}
        let people={
            name:'杨院长',
            hp:100,
            mp:100,
            xp:20000,
            leve:20,
            fangyuli:200,
            gongjili:30,
            buff:[],
            debuff:[],
            status:1,
            yichangzhuangtai:[],
            shiyongwupin(){},
            chuanzhuangbei(yingguangbang){
                this.gongjili+=yingguangbang.gongjili
            },
            move(){},
            gongji(oStr){
                return '攻击'+oStr
            },
            kaibao(){}
        }
        let guaiwu={
            name:'哈基米',
            hp:100,
            mp:100,
            xp:20000,
            level:20,
            fangyuli:200,
            gongjili:30,
            buff:[],
            debuff:[],
            status:1,
            yichangzhuangtai:[],
            move:()=>{},
            gongji(oStr){
                return '攻击'+oStr
            },
        }
        let wupin={
            yao:{
                xuebao:{
                    desc:'上帝的口水',
                    jiaxue(){
                        console.log('加血');
                        
                    }
                }
            },
            zhuangbei:{
                yingguangbang:{
                    gongjili:999,
                    desc:'接近怪物500范围内，自动调戏怪物',
                    zengjiagongji(){
                        console.log('加攻击');
                        
                    }
                }
            }
        }
        people.chuanzhuangbei(wupin.zhuangbei.yingguangbang)
        console.log(people.gongjili);

        let gongji=people.gongji(guaiwu.name)
        console.log(people.name+gongji);
        let gs=(people.gongjili-guaiwu.fangyuli)<0?0:(people.gongjili-guaiwu.fangyuli)
        console.log(gs);
        console.log(guaiwu.hp);
        guaiwu.hp=guaiwu.hp-gs
        console.log(`${guaiwu.name}当前的hp:${guaiwu.hp}`);
    
        
        
        
        
        
        
    </script>
</body>
</html>